package com.imooc.module.reponse;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class QueryDataResponse extends Response<QueryDataResponse.Table> {

    private Table table;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class Table{
        /**
         * 应用标题
         */
        private String title;
        /**
         * subTitle应用标题
         */
        private String subTitle;
        /**
         * 表头指标参数
         */
        private String[] columns;
        /**
         * 报表
         */
        private List<TableData> datas;
        /**
         * 图表
         */
        private List<TableChart> list;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class TableData {
        /**
         * 是否可点击
         */
        private Boolean clickAble;
        /**
         * 是否汇总
         */
        private Boolean isSummary;
        /**
         * 群组、机构名称 以及指标值
         */
        private String[] columns;
    }

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    public static class TableChart {
        /**
         * title
         */
        private String title;
        private Integer height;
        private Integer width;
        private List<Item> itemList;

        @Data
        @NoArgsConstructor
        @AllArgsConstructor
        public static class Item{
            private String type;
            private String title;
            private List<DataDTO> dataList;

            @Data
            @NoArgsConstructor
            @AllArgsConstructor
            public static class DataDTO{
                private String name;
                private String value;
                private List<DataDTO> data;
            }
        }
    }

}
